1. Field of the Invention
The present invention relates to image processing performed in an image processing apparatus such as a camera cellular phone, digital camera, or camcorder, and, more particularly, to an apparatus and method of compressing a dynamic range of an image.
2. Description of the Related Art
When an image having a severe contrast is photographed using an image processing apparatus, for example, a digital camera, a camcorder, or the like, an image that is too bright or too dark is obtained. In other words, if a dynamic range of an image is large, an image different from what human eyes recognize is obtained by the image processing apparatus. The dynamic range of the image denotes a brightness range between the darkest and brightest parts of the image. If a person standing in front of a bright window is photographed by a camera, features recognized by human eyes are not captured by the camera, and instead a darkened person standing in front of a bright window is taken by the camera. This problem may be solved by performing postprocessing, similar to characteristics of a human eye, on a photographed image using a Retinex algorithm proposed by Edwin Land. However, the postprocessing is executed on an image that has already been digitally quantized, so a severely saturated part of the image is inevitably degraded in quality due to an error of quantization.
With widespread types of image processing apparatuses, interest in digital images continue to increase. However, many difficulties still remain for common users of these apparatuses, i.e., other than professional photographers, to have a good-quality image. When a human being or an object standing in front of a bright window is photographed inside a room, or an image is photographed with back light, an almost unrecognizable picture is obtained. This is not only because this photography deals with a digital image, but also because of a difference between image acquisition characteristics of a human eye and a camera. Fortunately, however, this difference in the case of digital images can be offset to some extent by postprocessing executed by a computer or the like.
To interpret an object, a human being recognizes the object not only through the eyes but also through the cerebral cortex that processes image information. This fact is well known by a theory called Retinex established through pioneer research by Edwin Land. Retinex is a compound word of a retina and a cortex. The core of the Retinex theory is that pixel values of an image landing on a camera are determined based on physical light amounts of pixels, whereas an image viewed by a human eye is recognized as a relative value corresponding to a ratio of a value of each pixel of an image to a brightness distribution around the pixel. This can be easily understood from a phenomenon in which a gray color looks darker to a human eye when the gray is on a white background than on a black background. Daniel J. Jobson, Zia-ur Rahman, Glenn A. Woodell, and others, who were researchers for NASA, established a theory known as “Multi Scale Retinex” through several related experiments and improvements based on the Retinex theory. The theory of “Multi Scale Retinex” was introduced by A. Moore, J. Allman, and R. M. Goodman, March 1991, in paper “A Real-time Neural System for Color Constancy”, IEEE Trans. Neural Networks, vol. 2, pp. 237-247.
According to Retinex filtering as disclosed in the paper, a result of Gaussian filtering of a widely spread periphery is subtracted from a value of a center pixel value. A difference between the center and periphery values, instead of a ratio therebetween, is obtained because of log characteristics of the sense of sight, that is, a relationship of log(A/B)=log(A)−log(B), wherein two values are A and B. By using this method, a dark part of an image becomes brighter, and a bright part thereof becomes darker. For example, if an image having a pixel range of 0 to 255 between the darkest and brightest pixels is Retinex processed, the pixel range can be compressed into a range of about 40 to 200. A phenomenon in which a dynamic range of 0 to 255 is narrowed to a range of about 40 to 200 is referred to as a dynamic range compression.
In a printed image or a display, a variation of a scene reflectance recognizable by the human eye is usually in the range of 20:1 to 50:1 at most, whereas a variation, that is, a ratio, of the scene reflectance recognizable by a camera amounts to at least 2000:1. Due to this difference between the scene reflectance variations, when an image photographed by a camera is sampled to 8 bits and displayed, the displayed image is different from an image actually recognized by the human eye. The image which is different from the image actually recognized by the human eye, that is, a degraded image, can be prevented from being displayed by implementing Retinex as an analog circuit or by performing high-resolution analog-to-digital conversion (ADC) of 10-14 bits instead of 8 bits. If high-resolution ADC of 10-14 bits is used, a high-performance digital signal processor (DSP) is needed. Since a Retinex algorithm is basically based on a large-sized convolution, many calculations are needed, and the number of calculations increases in proportion to the number of pixels. Due to the continuing development of hardware, it is true that the performance of DSP's is also continuing to improve, but the resolution of images is also increasing commensurately. Hence, when Retinex processing depends on a DSP, the Retinex processing may be useful for still images, which can be processed by a digital camera relatively free from a time limit. However, the Retinex processing depending on a DSP causes a large amount of power consumption when real time processing and mobility are required, as in moving image photography by digital camcorders or recent digital cameras. As implemented by Glenn Hines and others, a 256×256 gray image can be processed at 20 frames per second using a 150 MHz floating point DSP. If the same DSP system processes a general VGA color image, the number of calculations needed significantly increases. Even when a summed area table (SAT) method or other optimization methods are introduced to reduce the number of needed calculations, it is difficult to cope with a wide variation of a scene reflectance when characteristics of a sensor are changed.
In an Analog-VLSI structure proposed by Andrew Moore and others, a degradation of an image is prevented by controlling a gain of the image prior to ADC. However, in this case, a resistive grid for obtaining a periphery value of a target pixel should be made to have a ratio similar to an image resolution, such that mass production may be hindered. In addition, a method of obtaining a periphery value of a target pixel is fixed, such that the Analog-VLSI structure has difficulty in having an improved structure, such as multi scale Retinex.